<?php
include('phpgraphlib.php'); 
include 'Classes/CalculateClass.php';
session_start();
$graph=new PHPGraphLib(900,420);
$objCalculateCass = new CalculateClass();

if(isset($_SESSION["user_id"]) && strlen($_SESSION["user_id"])>0)
{
	$userId = $_SESSION["user_id"];
}
else
{
	header("Location:index.php");
	exit;
}

$WorkExperienceVal=0;
$Education=0;
$Extracurriculars = 0;
$GMAT=0;

//===============Calculations STARTS=============================================================		
$WorkExperienceVal =  $objCalculateCass->CalculateCompanyNamePoints($userId);
$Education = $objCalculateCass->CalculateEducationPoints($userId);
$Extracurriculars = $objCalculateCass->CalculateExtraCurricularAcitivitesPoints($userId);
$GMAT = $objCalculateCass->CalculateGMATPoints($userId);
$Overall_Application_Strength = round(($WorkExperienceVal+$Education+$Extracurriculars+$GMAT)/4);
$_SESSION["application_rating"] = $Overall_Application_Strength;
//===============Calculations ENDS=============================================================

$data=array("Work Experience" => $WorkExperienceVal, "Education" => $Education, "Extracurriculars" => $Extracurriculars, "GMAT" =>$GMAT, "Overall Application Strength" => $Overall_Application_Strength);
$graph->addData($data);

$graph->setBarColor('blue','lime');
$graph->setTitle('Profile Strength Assesment');
$graph->setupYAxis(20, 'black');
$graph->setupXAxis(20);
$graph->setGrid(true);
/*$graph->setLegend(true);*/
$graph->setTitleLocation('center');
$graph->setTitleColor('black');
/*$graph->setLegendOutlineColor('white');
$graph->setLegendTitle('sample1', 'sample2','sample3');*/
$graph->setXValuesHorizontal(true);
$graph->createGraph();
?>